import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:sonora/bloc/base/sj_base_event.dart';
import 'package:sonora/shared/lib/exception/base/sj_app_exception_wrapper.dart';

part 'sj_common_event.freezed.dart';

abstract class SjCommonEvent extends SjBaseEvent {
  const SjCommonEvent();
}

@freezed
class SjExceptionEmitted extends SjCommonEvent with _$SjExceptionEmitted {
  const factory SjExceptionEmitted({
    required SjAppExceptionWrapper appExceptionWrapper
  }) = _SjExceptionEmitted;
}

@freezed
class SjLoadingVisibilityEmitted extends SjCommonEvent with _$SjLoadingVisibilityEmitted {
  const factory SjLoadingVisibilityEmitted({
    required bool isLoading
  }) = _SjLoadingVisibilityEmitted;
}

@freezed
class SjAlertVisibilityEmitted extends SjCommonEvent with _$SjAlertVisibilityEmitted {
  const factory SjAlertVisibilityEmitted(
      {String? msg,
      String? title,
      String? commitBtnTitle,
      Function? sureClicked,
      required bool isShowAlert}) = _SjAlertVisibilityEmitted;
}

@freezed
class SjForceLogoutButtonPressed extends SjCommonEvent with _$SjForceLogoutButtonPressed {
  const factory SjForceLogoutButtonPressed() = _SjForceLogoutButtonPressed;
}
